package com.yaoge;

import com.yaoge.domain.Student;
import com.yaoge.util.MybatisUtil;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

public class MyApp {
    public static void main(String[] args) throws IOException {
        MybatisUtil mybatisUtil=new MybatisUtil();
        SqlSession sqlSession= mybatisUtil.getSqlSession();
        String sqlId="com.yaoge.dao.StudentDao.selectStudents";
        List<Student> studentList=sqlSession.selectList(sqlId);
        for(Student student:studentList){
            System.out.println("student--->"+student);
        }
        sqlSession.close();
    }
}
